#include <stdint.h>
#include "stm32f1xx_hal.h"
#include "stm32f1xx_hal_def.h"
#include "stm32f1xx_hal_gpio.h"
#include "FreeRTOS.h"
#include "task.h"
#include "projdefs.h"

#define TASK_NUMS (2u)

uint32_t debug_variable[TASK_NUMS] = {0};

static void my_task1(void *arg)
{
    TickType_t delay_20ms = pdTICKS_TO_MS(20);
    while(1) {
        debug_variable[0]++;
        vTaskDelay(delay_20ms);
    }
}

static void my_task2(void *arg)
{
    TickType_t delay_50ms = pdTICKS_TO_MS(50);
    while(1) {
        debug_variable[1]++;
        vTaskDelay(delay_50ms);
    }
}

void create_my_task(void)
{
    xTaskCreate(my_task1, "my_task1", 128, NULL, 1, NULL);
    xTaskCreate(my_task2, "my_task2", 128, NULL, 1, NULL);
    vTaskStartScheduler();
}


